package m4d2;

import java.util.*;
import java.util.stream.Stream;

//获取Stream流
public class nGetStream {
    public static void main(String[] args) {
        //集合转换为流
        List<String> list = new ArrayList<>();
        Stream<String> stream1 = list.stream();

        Map<String,String> map = new HashMap<>();
        Set<String> set = map.keySet();
        Stream stream2 = set.stream();

        //数组转换流
        Stream<Integer> stream3 = Stream.of(1,2,3);
        Integer[] integers = {1,2,3};
        Stream<Integer> stream4 = Stream.of(integers);
    }
}
